#!/bin/bash

make
strip cbmc.exe

VERSION=`./cbmc.exe --version`
VERSION_FILE=`echo $VERSION | sed "y/./-/"`

echo $VERSION_FILE

(cd ../goto-cc; make; strip goto-cc.exe ; cp goto-cc.exe goto-cl.exe)
(cd ~/progr/hw-cbmc.vs32/trunk/src/hw-cbmc; make; strip hw-cbmc.exe)
(cd ../goto-instrument; make; strip goto-instrument.exe)

mkdir /tmp/cbmc-dist
cp ~/progr/hw-cbmc.vs32/trunk/src/hw-cbmc/hw-cbmc.exe ../cbmc/cbmc.exe \
   ../goto-cc/goto-cl.exe ../goto-instrument/goto-instrument.exe \
   /tmp/cbmc-dist/
cp ~/progr/cbmc.vs64/trunk/src/cbmc/cbmc.exe /tmp/cbmc-dist/cbmc64.exe
cp ../../LICENSE /tmp/cbmc-dist/LICENSE.txt
unix2dos /tmp/cbmc-dist/LICENSE.txt
cd /tmp/cbmc-dist
zip -9 cbmc-${VERSION_FILE}-win.zip hw-cbmc.exe cbmc.exe \
  cbmc64.exe goto-instrument.exe goto-cl.exe LICENSE.txt

echo Copying.
scp cbmc-${VERSION_FILE}-win.zip kroening@dkr-srv.cs.ox.ac.uk:/srv/www/cprover.org/cbmc/download/

cd /tmp
rm -R /tmp/cbmc-dist
